<?php

include dirname(__FILE__).'/../inc/bootstrap.php';

$db = DatabaseFactory();

$users = new UsersTable($db);
$messages = new MessagesTable($db);

//$user = $users->find_by_login_and_pwd('ren', '123');

/*$user = $users->find(array(
	'type' => 'all',
	'alias' => 'u',
	'join' => array(
		'm' => array(
			'on' => ':m.user_id = :u.id',
			'table' => $messages,
		),
	),
	'cond' => array(
		':login = ? AND :pwd = ?',
		'ren', '123'
	),
	'order' => ':id',
	'group' => ':login',
	'limit' => '5',
));

pr($user);*/

$users->update(array(
	'login' => 'test',
	'pwd'   => '123',
), array('id = ?', 1));

Log::pr();
